#pragma once
#include "EpilNumberObject.h"


class EpilInterpreter;


class EpilNumberManager
{
public:
	EpilNumberManager( EpilInterpreter * interpreter );
	~EpilNumberManager();

	static const int					SmallNumberMin = -5;
	static const int					SmallNumberMax = 257;

	EpilNumberObject *					CreateNumberObject( double value );
	void								ReleaseNumberObject( EpilNumberObject * obj );

private:
	bool								IsSmallNumber( double value );

	EpilNumberObject *					CreateSmallNumber( double value );
	void								ReleaseSmallNumber( EpilNumberObject * obj );
	EpilNumberObject *					CreateNormalNumber( double value );
	void								ReleaseNormalNumber( EpilNumberObject * obj );

	EpilInterpreter *					m_interpreter;
	EpilNumberObject *					m_smallNumberPool[SmallNumberMax - SmallNumberMin + 1];
};
